<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>宿舍缺勤记录修改</title>
  <style>
    body, html {
      margin: 0;
      padding: 0;
      font-family: Arial, sans-serif;
    }
    .header {
      background-color: #007BFF;
      color: white;
      padding: 10px;
      text-align: center;
    }
    .content {
      margin: 20px;
      padding: 20px;
    }
    .form-container {
      background-color: #fff;
      padding: 20px;
      border-radius: 5px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
    label {
      display: block;
      margin-bottom: 10px;
    }
    input[type="text"], select {
      width: 100%;
      padding: 8px;
      margin-bottom: 20px;
      border: 1px solid #ddd;
      border-radius: 5px;
    }
    .btn {
      background-color: #4CAF50;
      color: white;
      padding: 10px 20px;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }
    .btn:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
<div class="header">
  <h1>宿舍缺勤记录修改</h1>
  <div class="current-user">当前用户: admin</div>
</div>
<div class="content">
  <div class="form-container">
    <c:forEach var="i" items="${requestScope.list}">
    <form action="updateAbsence" method="post">
      <label for="user_id">学生ID:</label>
      <input type="text" id="user_id" name="user_id" value="${i.user_id}"  required>
      <label for="building">宿舍楼:</label>
      <select id="building" name="building" required>
        <c:forEach var="building" items="${requestScope.buildings}">
          <option value="${building.buildingCard}">${building.buildingCard}</option>
        </c:forEach>
        <!-- 选项将从数据库中动态生成 -->
      </select>
      <label for="room">寝室:</label>
      <input type="text" id="room" name="room" value="${i.room_num}" required>

      <input type="submit" value="修改" class="btn">
    </form>
    </c:forEach>
  </div>
</div>
</body>
</html>